# 以表格的形式输出学生信息
students = [
    {"name": "张三", "age": 18, "score": 90},
    {"name": "李四", "age": 19, "score": 85},
    {"name": "王五", "age": 20, "score": 95}
]


def print_students(data):
    """
    打印学生信息表格
    """
    print(f"{'姓名':<10}{'年龄':<8}{'分数':<6}{'等级':<6}")  # 所有表头左对齐，姓名长度为10，年龄长度为8，分数长度为6
    print("-" * 40)  # 分隔线，总宽度为24（10+8+6）
    for item in data:
        name = item["name"]
        age = item["age"]
        score = item["score"]
        if score >= 90:
            level = "优秀"
        elif score >= 80:
            level = "良好"
        elif score >= 70:
            level = "中等"
        elif score >= 60:
            level = "及格"
        else:
            level = "不及格"

        print(f"{name:<10}{age:<10}{score:<8}{level:<6}")
        print("-" * 40)  # 分隔线，总宽度为24（10+8+6）

print_students(students)